package br.com.comdoc.DAO;

import br.com.comdoc.configuracoes.configuracaoInicializacao;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;

public class LinkDB {

    public static Connection getConnection() throws ClassNotFoundException, SQLException {
        
        ArrayList list = configuracaoInicializacao.bancoDadosParametros();
        String ip = (String) list.get(0);
        String banco = (String) list.get(1);
        String usuario = (String) list.get(2);
        String senha = (String) list.get(3);
        
        Class.forName("com.mysql.jdbc.Driver");
        return DriverManager.getConnection("jdbc:mysql://"
                + ip + "/"
                + banco, 
                usuario, 
                senha);

    }
}
